import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Girl from '@/components/Girl'
import Boy from '@/components/Dynamic'
import NOT from '@/components/404'
import Father from '@/components/Father'
import Son from '@/components/Son'
import Dauther from '@/components/Dauther'
import GradSon from '@/components/GradeSon'
import Milf from '@/components/Milf'
import Animal from '@/components/animal/Animal'
import Cat from '@/components/animal/Cat'
import Fish from '@/components/animal/Fish'
import Tigger from '@/components/animal/Tigger'
import Dog from '@/components/animal/Dog'
import ZhangWei from '@/components/alias/ZhangWei'
import ZhangYiDa from '@/components/alias/ZhangYiDa'
import Teacher from '@/components/props/Teacher'
import Sun from '@/components/watch/SunShangXiang'
import Sun2 from '@/components/watch/Sun2'
import DaWa from '@/components/zujian/DaWa'
import Dad from '@/components/zujian/dad'
import Chanken from '@/components/animal/Chanken';
import Birdge from '@/components/animal/Birdge'
import Panader from '@/components/animal/Panader'
import Gundong  from "../components/gundong/Gundong";
import Chacao from "../components/chacao/Chacao";
import jumingchacao from "../components/chacao/jumingchacao";
import scopeslot from "../components/chacao/scopeslot";
Vue.use(Router)
let girl = {
  name:'张花',
  age:16
}
export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld,

    },
    {
      path:'/milf',
      name:"milf",
      component:Milf
    },

   {
     path:'/girl',
     name:'Girl',
     component:Girl
   } ,
   {

     path:'/boy/:id', //动态参数路径 以:开头 只有单参数 不知道多参数怎么传
     name:'Boy',
     component:Boy
   },

   {
     path:'*' ,//放在最后  可以给个404页面
     name:'not',
     component:NOT
   },
   {
     path:'/father',
     name:'father',
     component:Father,
     //嵌套路由
     children:[
       {
         path:'/son',
         name:'son',
         component:Son,
         children:[
           {
             path:'gradson',   //这种就是二级  访问地址是  /son/gradson/
             name:'gradson',
             component:GradSon

          }
         ]
       },
       {
         path:'/dauther',
         name:"dauther",
         component:Dauther

      },


     ]


   },
   //命名视图
    {
      path:'/animal',
      name:'animal',
      component:Animal,
      children:[
        {
          path:'small',
          name:'small',
          components:{
            default:Cat,
            cat:Cat,
            fish:Fish,
            tigger:Tigger,
            dog:Dog
          }
        },
        {
          path:'chanken',
          name:'chanken',
          component:Chanken
        },
        {
          path:'birdge',
          name:'birdge',
          component:Birdge
        },
        {
          path:'panader',
          name:'panader',
          component:Panader
        },

      ]

   },


    {
      path:'/zhangyida',
      name:'zhangyida',
      component:ZhangYiDa
    },
    //重定向
    {
      path:'/zhangwei',
      name:'zhangwei',
      component:ZhangWei,
      redirect:'/zhangyida'
     },
     //别名
    {
      path:'/zhangwei2',
      name:'zhangwei2',
      component:ZhangWei,
      alias:'/zhangyida2'
     },
     //传参
     {
      path:'/teacher/:id',
      name:'teacher',
      component:Teacher,
      props:true

    },
     //传对象
     {
      path:'/teacher2',
      name:'teacher2',
      component:Teacher,
      props: { newsletterPopup: false }

    },
    //监控数据
    {
      path:'/sun',
      name:'sun',
      component:Sun,
       children:[
        {
          path:'sun2',
          name:'sun2',
          components:{
            sun2:Sun2
          }
        }
       ]

    },
    //组件应用
    {
      path:'/dawa',
      name:'dawa',
      component:DaWa
    },
      //组件传值
      {
        path:'/dad',
        name:'dad',
        component:Dad
      },
    {
      path:'/gundong',
      name:'gundong',
      component:Gundong,
    },
    {
      path:'/chacao',
      name:'chacao',
      component:Chacao,
    },
    {
      path:'/jumingchacao',
      name:'jumingchacao',
      component:jumingchacao,
    },
    {
      path:'/scope-slot',
      name:'scopeslot',
      component:scopeslot,
    },



  ]
})
